<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Alpine.js x-transition directive.</title>

    <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
    <script defer src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<!--01. Normal-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition>Content</span>
</div>

<!--02. Duration-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.duration.500ms>Content</span>
</div>

<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition:enter.duration.500ms x-transition:level.duration.1000ms>Content</span>
</div>

<!--03. Delay-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.delay.50ms>Content</span>
</div>

<!--04. Opacity-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.opacity>Content</span>
</div>

<!--05. Scale-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.scale>Content</span>
</div>
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.scale.80>Content</span>
</div>
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition:enter.scale.80 x-transition:level.scale.80>Content</span>
</div>
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span x-show="open" x-transition.scale.origin.top>Content</span>
</div>

<!--06. Applying css classes-->
<div x-data="{ open: false }">
    <button x-on:click="open = ! open">Toggle</button>

    <span3 x-show="open"
         x-transition:enter="transition ease-out duration-300"
         x-transition:enter-start="opacity-0 scale-90"
         x-transition:enter-end="opacity-100 scale-100"
         x-transition:leave="transition ease-in duration-300"
         x-transition:leave-start="opacity-100 scale-100"
         x-transition:leave-end="opacity-0 scale-90"
    >Content
    </span3>
</div>

</body>
</html>